package com.dmp.onlinestore.controller;

import java.io.IOException;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

//import com.dmp.onlinestore.apps.TestPagingApp;
//import com.dmp.onlinestore.model.dto.ProductBean;
//import com.dmp.onlinestore.model.dto.ProductBeanFilterSpec;
//import com.dmp.onlinestore.model.service.Catalog;
//import com.dmp.onlinestore.model.service.impl.CatalogImpl;
//import com.dmp.onlinestore.model.service.impl.ProductBeanPagerImpl;

/**
 * Servlet implementation class Controller
 */
public class ControllerOrig extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public ControllerOrig() {
        super();
    }

	/**
	 * @see Servlet#init(ServletConfig)
	 */
	public void init(ServletConfig config) throws ServletException {
		super.init(config); 
		
		System.out.println("Servlet.init");
	}
	
	

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
//        Catalog store = CatalogImpl.instance();	
//		List<ProductBean> rs = store.getProducts();
//		request.setAttribute("resultSet", rs);
//		
//        try {
//  	      getServletConfig().getServletContext().getRequestDispatcher(
//  	        "/jsp/Catalog.jsp").forward(request,response);
//
//  	    } catch (ServletException e) {
//  	    	System.out.println("Servlet Exception");
//  	      e.printStackTrace();
//  	    } catch (IOException e) {
//  	    	System.out.println("IO Exception");
//  	      e.printStackTrace();
//  	    } 
  	    
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request,response);	
	}

}
